#ifndef WORKER_H_
#define WORKER_H_

#include "zthread/Thread.h"
#include "zthread/Runnable.h"
#include "../Exception/GA_Exception.h"

class Framework;

/** Base class for all worker threads.
 */
class Worker : public ZThread::Runnable
{
    public:
        Worker();
        void setFramework(Framework*);  /**< Sets the framework to work with               */
        void requestHalt();             /**< Tells the worker to halt as soon as possible */
        
        virtual void run() = 0;         /**< Abstract run function                        */
        
    protected:
        bool haltRequested;             /**< Flag indicating a halt has been requested    */
        Framework *framework;           /**< Pointer to the framework being used          */
};

#endif /*WORKER_H_*/
